The present disclosure relates generally to optimizing the initialization of a queue via a batch operation, and more specifically, to improving, via a batch operation, the processing involved in populating a queue of elements while maintaining proper serialization to ensure the integrity and accuracy of the queue.
In general, when a queue of elements is being initialized (e.g., queue initialization), a service routine is called/executed by the processor for each individual element being moved to the queue. This service routine separately handles queuing of the individual element and housekeeping associated with the queue (e.g., updating counts, creating appropriate trace entries, etc.). Further, as each element represents a resource within a system, proper serialization via a system lock must be maintained throughout queue initializations to prevent premature use of resources represented by the queue elements and to ensure the integrity and accuracy of the queue. In this way, contemporary approaches to queue initialization is a ‘one at a time’ processing.
This ‘one at a time’ processing leads to high lock contention of resources since the system lock used for a queue also serializes other system resources. Further, other processes that need the system lock must wait until the queue initialization is complete, which causes ripple delays. In addition, in cases where the number of elements on the queue grows based on the size of the system, the overhead processing time associated with queue initialization increases significantly as the size of the system increases. With size increases, scalability issues arise with respect to memory capacity, a number of supported devices, a number of supported processors, etc.